3.1009 \(\int \frac{a b B-a^2 C+b^2 B \cos (c+d x)+b^2 C \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx\)

Optimal. Leaf size=23 \[ x (b B-a C)+\frac{b C \sin (c+d x)}{d} \]

[Out]

(b*B - a*C)*x + (b*C*Sin[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0231874, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 48, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.042, Rules used = {24, 2637} \[ x (b B-a C)+\frac{b C \sin (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a*b*B - a^2*C + b^2*B*Cos[c + d*x] + b^2*C*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

(b*B - a*C)*x + (b*C*Sin[c + d*x])/d

Rule 24

Int[(u_.)*((a_) + (b_.)*(v_))^(m_)*((A_.) + (B_.)*(v_) + (C_.)*(v_)^2), x_Symbol] :> Dist[1/b^2, Int[u*(a + b*
v)^(m + 1)*Simp[b*B - a*C + b*C*v, x], x], x] /; FreeQ[{a, b, A, B, C}, x] && EqQ[A*b^2 - a*b*B + a^2*C, 0] &&
 LeQ[m, -1]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{a b B-a^2 C+b^2 B \cos (c+d x)+b^2 C \cos ^2(c+d x)}{a+b \cos (c+d x)} \, dx &=\frac{\int \left (b^2 (b B-a C)+b^3 C \cos (c+d x)\right ) \, dx}{b^2}\\ &=(b B-a C) x+(b C) \int \cos (c+d x) \, dx\\ &=(b B-a C) x+\frac{b C \sin (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.0107633, size = 34, normalized size = 1.48 \[ -a C x+b B x+\frac{b C \sin (c) \cos (d x)}{d}+\frac{b C \cos (c) \sin (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*b*B - a^2*C + b^2*B*Cos[c + d*x] + b^2*C*Cos[c + d*x]^2)/(a + b*Cos[c + d*x]),x]

[Out]

b*B*x - a*C*x + (b*C*Cos[d*x]*Sin[c])/d + (b*C*Cos[c]*Sin[d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.024, size = 32, normalized size = 1.4 \begin{align*}{\frac{Cb\sin \left ( dx+c \right ) +bB \left ( dx+c \right ) -aC \left ( dx+c \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x)

[Out]

1/d*(C*b*sin(d*x+c)+b*B*(d*x+c)-a*C*(d*x+c))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.56482, size = 55, normalized size = 2.39 \begin{align*} -\frac{{\left (C a - B b\right )} d x - C b \sin \left (d x + c\right )}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="fricas")

[Out]

-((C*a - B*b)*d*x - C*b*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [A]  time = 0.90777, size = 58, normalized size = 2.52 \begin{align*} \begin{cases} B b x - C a x + \frac{C b \sin{\left (c + d x \right )}}{d} & \text{for}\: d \neq 0 \\\frac{x \left (B a b + B b^{2} \cos{\left (c \right )} - C a^{2} + C b^{2} \cos ^{2}{\left (c \right )}\right )}{a + b \cos{\left (c \right )}} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a**2*C+b**2*B*cos(d*x+c)+b**2*C*cos(d*x+c)**2)/(a+b*cos(d*x+c)),x)

[Out]

Piecewise((B*b*x - C*a*x + C*b*sin(c + d*x)/d, Ne(d, 0)), (x*(B*a*b + B*b**2*cos(c) - C*a**2 + C*b**2*cos(c)**
2)/(a + b*cos(c)), True))

________________________________________________________________________________________

Giac [B]  time = 1.24834, size = 65, normalized size = 2.83 \begin{align*} -\frac{{\left (C a - B b\right )}{\left (d x + c\right )} - \frac{2 \, C b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*b*B-a^2*C+b^2*B*cos(d*x+c)+b^2*C*cos(d*x+c)^2)/(a+b*cos(d*x+c)),x, algorithm="giac")

[Out]

-((C*a - B*b)*(d*x + c) - 2*C*b*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 + 1))/d